package ar.edu.unlp.info.tesis.database.operator;

import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Expression;

public class IsNotNullRestriction extends OperatorRestriction {

	private boolean operador;
	public IsNotNullRestriction(String field, boolean operador) {
		super(field);
		this.operador = operador;
	}

	@Override
	public Criterion getExpresion() {
		if(operador)
			return Expression.isNotNull(this.getField());
		return Expression.isNull(this.getField());

	}

}
